package org.pb.basic.query;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 查询条件实体类的模板类
 * @author
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseQuery {

    /**
     * 当前页
     */
    private Integer currentPage = 1;

    /**
     * 每页数据大小
     */
    private Integer pageSize = 5;

    /**
     * 关键字查询参数
     */
    private String keyword;

    /**
     * @return 返回当前页的索引起始值
     */
    public Integer getIndex() {
        return (this.currentPage - 1) * this.pageSize;
    }

}
